<template>
  <div class="w-full upload-textarea-container">
    <a-button size="small" class="mb-2" @click="$emit('click', $event)">
      <template #icon>
        <upload-outlined />
      </template>
      点击上传
    </a-button>
    <a-textarea class="sl-select-textarea" v-bind="$attrs" :placeholder="placeholder" readonly>
      <template #suffix>
        <Icon type="icon-you" />
      </template>
    </a-textarea>
  </div>
</template>
<script lang="ts">
export default {
  inheritAttrs: false,
};
</script>
<script setup lang="ts">
import { UploadOutlined } from "@ant-design/icons-vue";
import Icon from "/@/components/Icon.vue";
import { useI18n } from "/@/locales/useI18n";
defineEmits(["click"]);
const { t } = useI18n();
const props = withDefaults(
  defineProps<{
    placeholder: string;
  }>(),
  {
    placeholder: "...",
  }
);
</script>

<style lang="less">
.sl-select-textarea {
  cursor: pointer;
  background-color: #fbfbfb;
  textarea {
    background-color: transparent;
    cursor: pointer;
  }
}
.upload-textarea-container {
  .input-hidden {
    display: none !important;
  }
}
</style>
